﻿using System.Data;
using System.Threading.Tasks;
using Entity;

namespace IRepository
{
    public interface IProductInformationRepository
    {
        Task<ProductInformationEntity> GetByCodeAsync(string productCode, IDbTransaction transaction = null);
        // 新增：分页搜索货品
        Task<(List<ProductInformationEntity> list, int total)> SearchAsync(
            string keyword, string unit, int pageNum, int pageSize);

        Task<List<ProductInformationFind>> GetByCodeAsync(string? code = null, string? Unit = null);
        // 带仓库库存的搜索（核心修改：增加仓库ID参数）
        Task<(List<ProductInformationEntity> list, int total)> SearchWithStockAsync(
            string? keyword, int outWarehouseId, int inWarehouseId,  // 新增仓库ID参数
            int pageNum, int pageSize);
    }
}